package com.macro.mall.controller.admin;

import com.macro.mall.service.UmsResourceCategoryService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 后台资源分类管理Controller
 * Created by macro on 2020/2/5.
 */
@Controller
@Api(tags = "UmsResourceCategoryController", description = "后台资源分类管理")
@RequestMapping("/resourceCategory")
public class UmsResourceCategoryController {
    @Autowired
    private UmsResourceCategoryService resourceCategoryService;
//
//    @ApiOperation("查询所有后台资源分类")
//    @RequestMapping(value = "/listAll", method = RequestMethod.GET)
//    @ResponseBody
//    public ReturnObject<List<UmsResourceCategory>> listAll() {
//        List<UmsResourceCategory> resourceList = resourceCategoryService.listAll();
//        return ReturnObject.success(resourceList);
//    }
//
//    @ApiOperation("添加后台资源分类")
//    @RequestMapping(value = "/create", method = RequestMethod.POST)
//    @ResponseBody
//    public ReturnObject create(@RequestBody UmsResourceCategory umsResourceCategory) {
//        int count = resourceCategoryService.create(umsResourceCategory);
//        if (count > 0) {
//            return ReturnObject.success(count);
//        } else {
//            return ReturnObject.failed();
//        }
//    }
//
//    @ApiOperation("修改后台资源分类")
//    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
//    @ResponseBody
//    public ReturnObject<Integer> update(@PathVariable Long id,
//                               @RequestBody UmsResourceCategory umsResourceCategory) {
//        int count = resourceCategoryService.update(id, umsResourceCategory);
//        if (count > 0) {
//            return new ReturnObject<>();
//        } else {
//            return ReturnObject.failed();
//        }
//    }
//
//    @ApiOperation("根据ID删除后台资源")
//    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
//    @ResponseBody
//    public ReturnObject delete(@PathVariable Long id) {
//        int count = resourceCategoryService.delete(id);
//        if (count > 0) {
//            return ReturnObject.success(count);
//        } else {
//            return ReturnObject.failed();
//        }
//    }
}
